from sys import excepthook
class BaseError(Exception):
    def __init__(self, name = '', message = '') -> None:
        self.name = name
        self.message = message
        super().__init__(name, message)

    def __str__(self):
        return self.__repr__()
 
    def __repr__(self):
        return f'异常名称：{self.name}，信息：{self.message}'

class NotPrimaryKeyError(BaseError):
    def __init__(self) -> None:
        super().__init__('NotPrimaryKeyError', '需要为主键')

class EmptySceIndexTBName(BaseError):
    def __init__(self) -> None:
        super().__init__('EmptySceIndexTBName', '主键不存在二级索引表名')